package com.wj.wjpicture.domain.picture.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wj.wjpicture.domain.picture.entity.Picture;
import com.wj.wjpicture.domain.user.entity.User;
import com.wj.wjpicture.infrastructure.api.aliyun.model.CreateOutPaintingTaskResponse;
import com.wj.wjpicture.interfaces.dto.picture.*;
import com.wj.wjpicture.interfaces.vo.picture.PictureVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author 20231001
* @description 针对表【PictureUploadRequest(图片)】的数据库操作Service
* @createDate 2025-07-14 09:40:31
*/
public interface PictureDomainService {
    /**
     * 上传图片
     *
     * @param inputSource
     * @param pictureUploadRequest
     * @param loginUser
     * @return
     */
    PictureVO uploadPicture(Object inputSource,
                            PictureUploadRequest pictureUploadRequest,
                            User loginUser);


    /**
     * 删除图片
     */
    void deletePicture(long pictureId,User loginUser);

    /**
     * 将查询请求转为QueryWrapper对象
     *
     * @param pictureQueryRequest
     * @return
     */
    QueryWrapper<Picture> getQueryWrapper(PictureQueryRequest pictureQueryRequest);


    /**
     * 编辑图片(用户、管理员可用)
     */
    void editPicture(Picture picture, User loginUser);

    /**
     * 图片审核
     *
     * @param pictureReviewRequest
     * @param loginUser
     */
    void doPictureReview(PictureReviewRequest pictureReviewRequest, User loginUser);

    /**
     * 设置审核状态
     *
     * @param picture
     * @param loginUser
     */
    void fillReviewParams(Picture picture,User loginUser);

    /**
     * 批量抓取和创建图片
     */
    Integer uploadPictureByBatch(PictureUploadByBatchRequest pictureUploadByBatchRequest, User loginUser);

    /**
     * 清理图片
     */
    void clearPictureFile(Picture oldPicture);

    /**
     * 权限校验
     */
    void checkPictureAuth(User loginUser,Picture picture);

    /**
     * 按颜色查询图片
     */
    List<PictureVO> searchPictureByColor(Long spaceId,String picColor,User loginUser);

    /**
     * 批量修改图片
     */
    void editPictureByBatch(PictureEditByBatchRequest pictureEditByBatchRequest, User loginUser);

    /**
     * 创建扩图任务方法
     */
    CreateOutPaintingTaskResponse createPictureOutPaintingTask(CreatePictureOutPaintingTaskRequest createPictureOutPaintingTaskRequest
            , User loginUser);


}
